#include "widget.h"
#include "ui_widget.h"
#include <QMessageBox>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
    ,m_ptcpsocket(new QTcpSocket(this))
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::init_network(){
    m_ptcpsocket->connectToHost("127.0.0.1", 8099);

    connect(m_ptcpsocket, &QTcpSocket::connected, this, &Widget::connect_ok);

    return;
}

void Widget::connect_ok(){
    QMessageBox::information(this, "connect", "connect server success.");

    return;
}

